package com.dlwx.parttimetalent.adapter;

import android.content.Context;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.dlwx.parttimetalent.R;
import com.dlwx.parttimetalent.bean.TeamBean;

import de.hdodenhof.circleimageview.CircleImageView;

/**
 * Created by Administrator on 2017/11/21.
 */

public class TeamAdapter extends ListBaseAdapter<TeamBean.BodyBean> {
    private  Context context;
    public TeamAdapter(Context context) {
        super(context);
        this.context=context;
    }

    @Override
    public int getLayoutId() {
        return R.layout.item_team;
    }

    @Override
    public void onBindItemHolder(SuperViewHolder holder, int position) {
        TeamBean.BodyBean bean = getDataList().get(position);
        CircleImageView image_header=holder.getView(R.id.image_header);
        TextView tv_name=holder.getView(R.id.tv_name);
        TextView tv_price=holder.getView(R.id.tv_price);
        TextView tv_id=holder.getView(R.id.tv_id);
        Glide.with(context).load(bean.getHeadurl()).apply(new RequestOptions().placeholder(R.mipmap.logopro)).into(image_header);
        tv_name.setText(bean.getNickname());
        tv_price.setText(bean.getPrice());
        tv_id.setText("ID:"+bean.getUsernumber());

    }
}
